#pragma once

#include "..\duilib\uicommoncontrols.h"

#include "SoftWareNode.h"

using namespace DuiLib;

class UILIB_API CTabButtonUI  :  public COptionUI
{
public:
	CTabButtonUI();
	~CTabButtonUI();

	LPCTSTR GetClass() const;
	
	void PaintBkImage(HDC hDC);

	void DoEvent(TEventUI& event);

};

class CTabHorizontalLayoutUI  :  public CHorizontalLayoutUI
{
public:
	CTabHorizontalLayoutUI();
	virtual ~CTabHorizontalLayoutUI();

	LPCTSTR GetClass() const;

	void DoEvent(TEventUI& event);

	void PaintStatusImage(HDC hDC);
};

class UILIB_API CRHorizontalLayoutUI : public CHorizontalLayoutUI
{
public:
	CRHorizontalLayoutUI();
	virtual ~CRHorizontalLayoutUI();

	LPCTSTR GetClass() const;

	void DoPaint(HDC hDC, const RECT& rcPaint);
};


class UILIB_API CSoftwareNodeUI : public CVerticalLayoutUI,INotifyUI
{
public:
	CSoftwareNodeUI(CPaintManagerUI& pm);
	virtual ~CSoftwareNodeUI();

	LPCTSTR GetClass() const;
	void Init();
	void DoEvent(TEventUI& event);

	void Notify(TNotifyUI& msg);

	void SetSoftwareInfo(SOFTWARENODE* pstSoftNode, DWORD dwType = 0);
	void SetNodeType(DWORD dwType);

private:
	CButtonUI*       m_pDownload;
	CButtonUI*       m_pIntroduce;
	CButtonUI*		 m_pSetUp;
	CPaintManagerUI& paint_manager_;
	DWORD			 m_dwType;
};

class UILIB_API CDownloadingNodeUI : public CVerticalLayoutUI,INotifyUI
{
public:
	CDownloadingNodeUI(CPaintManagerUI& pm);
	virtual ~CDownloadingNodeUI();

	LPCTSTR GetClass() const;
	void Init();
	void DoEvent(TEventUI& event);

	void Notify(TNotifyUI& msg);

	void SetSoftwareInfo(SOFTWARENODE* pstSoftNode, DWORD dwState = -1);
	void SetNodeState(DWORD dwState);

private:
	CButtonUI*       m_pStart;
	CButtonUI*       m_pStop;
	CButtonUI*       m_pDelete;
	CButtonUI*       m_pIntroduce;
	CButtonUI*       m_pSetUp;
	CPaintManagerUI& paint_manager_;
	DWORD			 m_dwState;
};
